<?php
class Info extends Zend_Form
{
	public function init() 
	{
		$this->setMethod('post');
		$this->setAction('/tender/final/send');

		$sms = new Zend_Form_Element_Checkbox('sms', array('id'=>'sms'));
		$sms->setLabel('Отправить по SMS')
			->addFilter('StripTags')
			->addFilter('StringTrim')
			->addValidator('Digits')
			;
		$sms->setChecked(true);
		$sms->setValue(1);
		
		$email = new Zend_Form_Element_Checkbox('email', array('id'=>'email'));
		$email->setLabel('Отправить по E-mail')
			->addFilter('StripTags')
			->addFilter('StringTrim')
			->addValidator('Digits')
			;
		$email->setChecked(true);
		$email->setValue(1);

		$sbmt = new Zend_Form_Element_Submit('place');
		$sbmt->setLabel('Отправить');

		$this->addElements(array($sms, $email, $sbmt));

		foreach ( $this->getElements() as $element ) {
        	$element->setDecorators(
        		array(
		        	'ViewHelper',
        			'Errors',
		        	array(array('data' => 'HtmlTag'), array('tag' => 'div', 'id' => $element->getId().'-data')),
		        	array(array('label' => 'Label'), array('tag' => 'div', 'escape' => false)),
		        	array(array('row' => 'HtmlTag'), array('tag' => 'div', 'id' => $element->getId().'-element', 'class' => $element->class )),
	        	)
        	);
        }

		$sbmt->setDecorators(array('ViewHelper', array('data'=>'HtmlTag', 'tag'=>'div')));

        $this->setDecorators(array(
		    'FormElements',
		    array('HtmlTag', array('tag' => 'div', 'id' => 'tender-send')),
		    'Form',
		));
	}
}